<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>个人信息</title>
    <link rel="stylesheet" href="../../static/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" href="../../static/css/global.css" />
    <link rel="stylesheet" href="../../static/css/patient.css" />
</head>

<body>
    <!-- 弹窗组件 -->
    <div th:replace="~{reuse/alertBox::alertBox}"></div>
    <!-- 导航栏 -->
    <div th:replace="~{homepageFD::doctorHomeNav}"></div>
    <main class="mainBox" th:fragment="accountChange">
        <!-- content -->
        <div class="container shadow-md-sm">
            <div>
                <div class="container d-flex justify-content-between align-items-center labelBox">
                    <strong>可修改信息</strong>
                    <div>
                        <button th:if="${accountInfo == 'onshow'}" type="button"
                            class="btn btn-outline-secondary btn-sm">
                            <a th:href="@{/doctor/personal?update='true'}">修改</a>
                        </button>
                        <button th:if="${accountInfo == 'change'}" type="button" class="btn btn-outline-primary btn-sm">
                            <a th:href="@{/doctor/personal}">取消</a>
                        </button>
                        <button th:if="${accountInfo == 'change'}" type="submit" form="identifyForm"
                            class="btn btn-outline-primary btn-sm">
                            保存
                        </button>
                    </div>
                </div>
                <form action="/doctor/personal" method="post" id="identifyForm" class="container">
                    <div class="row justify-content-center mb-3 label">
                        <label for="account" class="col-4 col-md-1 col-form-label">
                            账户
                        </label>
                        <div class="col-8 col-md-7" th:switch="${accountInfo}">
                            <p th:case="onshow" class="form-control-plaintext">
                                [[${doctor}!=null?${doctor.account}:null]]
                            </p>
                            <input th:case="change" type="text" class="form-control" name="account"
                                th:value="${doctor}!=null?${doctor.account}:null" />
                        </div>
                    </div>
                    <div class="row justify-content-center mb-3">
                        <label for="password" class="col-4 col-md-1 col-form-label">
                            密码
                        </label>
                        <div class="col-8 col-md-7" th:switch="${accountInfo}">
                            <p th:case="onshow" class="form-control-plaintext">
                                [[${doctor}!=null?${doctor.password}:null]]
                            </p>
                            <input th:case="change" name="password" type="password" class="form-control"
                                th:value="${doctor}!=null?${doctor.password}:null" />
                        </div>
                    </div>
                    <div class="row justify-content-center mb-3">
                        <label for="email" class="col-4 col-md-1 col-form-label">
                            邮箱
                        </label>
                        <div class="col-8 col-md-7" th:switch="${accountInfo}">
                            <p th:case="onshow" class="form-control-plaintext">
                                [[${doctor}!=null?${doctor.email}:null]]
                            </p>
                            <input th:case="change" name="email" type="email" class="form-control"
                                th:value="${doctor}!=null?${doctor.email}:null" />
                        </div>
                    </div>
                    <div class="row justify-content-center mb-3">
                        <label for="phone" class="col-4 col-md-1 col-form-label">
                            电话号码
                        </label>
                        <div class="col-8 col-md-7" th:switch="${accountInfo}">
                            <p th:case="onshow" class="form-control-plaintext">
                                [[${doctor}!=null?${doctor.phone}:null]]
                            </p>
                            <input th:case="change" name="phone" type="tel" class="form-control"
                                th:value="${doctor}!=null?${doctor.phone}:null" />
                        </div>
                    </div>
                    <div class="row justify-content-center mb-3">
                        <label for="address" class="col-4 col-md-1 col-form-label">
                            住址
                        </label>
                        <div class="col-8 col-md-7" th:switch="${accountInfo}">
                            <p th:case="onshow" class="form-control-plaintext">
                                [[${doctor}!=null?${doctor.address}:null]]
                            </p>
                            <input th:case="change" name="address" type="text" class="form-control"
                                th:value="${doctor}!=null?${doctor.address}:null" />
                        </div>
                    </div>
                </form>
            </div>
            <div>
                <div class="container d-flex justify-content-between align-items-center labelBox">
                    <strong>不可修改信息</strong>
                    <div>如需订正请联络相关管理员</div>
                </div>
                <form action="#" method="post" id="identifyForm" class="container">
                    <div class="row justify-content-center mb-3 label">
                        <label for="name" class="col-4 col-md-1 col-form-label">
                            姓名
                        </label>
                        <div class="col-8 col-md-7">
                            <p class="form-control-plaintext">
                                [[${doctor}!=null?${doctor.name}:null]]
                            </p>
                        </div>
                    </div>
                    <div class="row justify-content-center mb-3 label">
                        <label for="sex" class="col-4 col-md-1 col-form-label">
                            性别
                        </label>
                        <div class="col-8 col-md-7">
                            <p class="form-control-plaintext">
                                [[${doctor}!=null?${doctor.sex}:null]]
                            </p>
                        </div>
                    </div>
                    <div class="row justify-content-center mb-3 label">
                        <label for="birthday" class="col-4 col-md-1 col-form-label">
                            出生日期
                        </label>
                        <div class="col-8 col-md-7">
                            <p class="form-control-plaintext">
                                [[${doctor}!=null?${doctor.birthday}:null]]
                            </p>
                        </div>
                    </div>
                    <div class="row justify-content-center mb-3 label">
                        <label for="idcard" class="col-4 col-md-1 col-form-label">
                            身份证号
                        </label>
                        <div class="col-8 col-md-7">
                            <p class="form-control-plaintext">
                                [[${doctor}!=null?${doctor.idcard}:null]]
                            </p>
                        </div>
                    </div>
                    <div class="row justify-content-center mb-3 label">
                        <label for="section" class="col-4 col-md-1 col-form-label">
                            所属科室
                        </label>
                        <div class="col-8 col-md-7">
                            <p class="form-control-plaintext">
                                [[${doctor}!=null?${doctor.section}:null]]
                            </p>
                        </div>
                    </div>
                    <div class="row justify-content-center mb-3 label">
                        <label for="position" class="col-4 col-md-1 col-form-label">
                            当前职位
                        </label>
                        <div class="col-8 col-md-7">
                            <p class="form-control-plaintext">
                                [[${doctor}!=null?${doctor.position}:null]]
                            </p>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </main>
    <script src="../../static/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>

</html>